A GUI control is a graphical user interface object produced by a software application or a software module to display a measure. For example, the GUI control may be a slider, a progress indicator, a gauge, a dial, and the like. In the case of a slider, a user can select a desired value on by manipulating a mouse to displace a movable component of the slider. With each change in position of the movable component, the slider notifies the associated software application or module of the new value.
Configured with a range of values and a unit of increment between each value, the GUI control can include tick marks to more precisely indicate the position of the movable component. For example, consider a vertically oriented GUI control with the movable component position corresponding to the volume level of a media player. A set of 11 tick marks uniformly spaced over the span of the GUI control divides the range of corresponding levels into 10 intervals. With the bottom tick mark indicating zero output and the top tick mark indicating maximum output, the user can easily determine the selected volume level as a percentage of the maximum output by simply observing the position of the movable component. Increasing the number of tick marks increases the precision. For example, the interval between two tick marks (major tick marks) can be further divided using minor tick marks to increase the precision.
In conventional GUI controls, tick marks are simply placed corresponding to each incremental value along the span of the GUI control. This prior art approach leads to a cumbersome and congested display of tick marks when the unit of increment becomes small or when the number of values in the range increases. A crowded display of tick marks greatly reduces its effectiveness as a simple value indicator.
In another prior art approach, the number of tick marks is hard-coded for each GUI control. This approach is problematic as well. For example, code generation becomes inefficient for an application that uses multiple GUI controls needing different numbers of tick marks. Moreover, code revisions require changes to be implemented on every instance of a GUI control. This approach makes the code generation and the revision processes error-prone.
Therefore, it would be desirable to provide an improved technique for automatic tick mark generation. In particular, it would be desirable to support automatic scaling of tick marks to avoid a crowded display or require manual overhead in hard-coding each GUI control instantiation.